<template>
    <div class="box">
        <div class="adt-com" v-if="info.list && info.list.length > 0">
            <div class="adt-i adl">
                <el-carousel :height="`250px`" :autoplay="true" indicator-position="none" arrow="never">
                    <el-carousel-item v-for="(banner, b) in info.list" :key="b">
                        <img :src="$imgUrl + banner.img" alt="" :style="{
            'height': `250px`,
            'border-radius': `5px`,
        }" class="img">
                    </el-carousel-item>
                </el-carousel>
            </div>
            <div class="adt-i adr flex flex-direction justify-between">
                <div class="ri" v-for="(item, index) in info.adlist" :key="index">
                    <img class="adimg" :src="$imgUrl + item.img"></img>
                </div>
            </div>
        </div>
        <div v-else>
            <empty icon="Picture" name="轮播模块" />
        </div>
    </div>
</template>

<script setup>
import empty from '../empty.vue'

const props = defineProps({
    info: { required: true },
});

</script>

<style lang="scss" scoped>
.box {
    width: 100%;
    box-sizing: border-box;

    .adt-com {
        width: 100%;
        height: auto;
        padding: 0 10px;
        display: flex;
        align-items: center;

        .adt-i {
            flex: 1;
            height: 250px;
        }

        .adl {
            padding-right: 5px;
            .img{
                width: 100%;
            }
        }

        .adr {
            padding-left: 5px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-direction: column;
            .ri {
                width: 100%;
                height: 120px;

                .adimg {
                    width: 100%;
                    height: 100%;
                    border-radius: 5px;
                }
            }
        }
    }
}
</style>